package com.gateway.controller;

import com.alibaba.csp.sentinel.annotation.SentinelResource;
import com.common.response.ResponseResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author xin.you
 * @date 2021/4/17
 * @description
 */
@RestController
public class TestController {

    @GetMapping("/test1")
    @SentinelResource(value = "test1")
    public ResponseResult test1(){
        String name=null;
        System.out.println("this is  gatway  降级测试");
        //测试异常降级
        if(name.equals("aa")){

        }
        return ResponseResult.success();
    }
}
